<%@ page contentType="text/html" %>
<%@ page pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<%@ include file="header.jsp" %>
		<div id="halfLeft">
			<h3>Login</h3>
			<p>If you are already registered, login</p>
			<div id="loginnotification">
			<% 
			   String login = (String)request.getAttribute("loginerror");
			   if(login!=null){//hubo error
			      %> <p class="ui-state-error"><%= login %></p> <%
			   }
			%>
			</div>
					<form method="POST" action="login" class="botones">
					<table>
						<tr>
							<td>User:</td>
							<td><input name="user" type="text"/></td>
						</tr>
						<tr>
							<td>Password:</td>
							<td><input name="pass" type="password"/></td>
						</tr>
					</table>
					<input name="login" type="submit" value="Login">
					</form>
					<a href="../index/forgotPass">Forgot your password?</a><br/>
					<a href="../index/resendConfirmation">Resend confirmation email</a>
	</div><% //login %>
	<div id="halfRight">
			<h3>Sign Up</h3>
			<p>If you are not registered, complete the following fields:</p>
				<div id="signupnotification">
					<% 
					   String signup = (String)request.getAttribute("signuperror");
					   String name = new String("");
					   String email = new String("");
					   if(signup!=null){//hubo error
					     name = (String)request.getAttribute("name");
					     email = (String)request.getAttribute("email");
					      %> <p class="ui-state-error"><%= signup %></p> <%
					   } else {
					     signup = (String)request.getAttribute("signupok");
					     if(signup!=null){
					       %> <p class="ui-state-highlight "><%= signup %></p> <%
					     }
					   }
					%>
				</div> <% //signup notification %>
				<form method="POST" action="signup" class="botones">
					<table>
						<tr>
							<td>User:</td>
							<td><input name="user" type="text" value="<%= name %>"/></td>
						</tr>
						<tr>
							<td>E-Mail:</td>
							<td><input name="email" type="text" value="<%= email %>"/></td>
						</tr>
						<tr>
							<td>Password:</td>
							<td><input name="pass1" type="password"/></td>
						</tr>
						<tr>
							<td>Retype Password:</td>
							<td><input name="pass2" type="password"/></td>
						</tr>
					</table>
					<input name="register" type="submit" value="Register">
					</form>
	</div><% //signup %>
	
	<div class="content">
		<h3>Description</h3>
		<p> <spring:message code="description" /> </p>
	<div>
	
<%@ include file="footer.jsp" %>